import { usePermissionStore } from '@/store'
const permission = {
  mounted(el, binding) {
    const { hasPermission } = usePermissionStore()
    if (binding.value && !hasPermission(binding.value)) {
      el.remove()
    }
  },
}

export function setupDirectives(app) {
  app.directive('permission', permission)
}
